﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace DAL
{
    public class DALLoginForm
    {

        public static SqlDataReader DengLu()
        {
            string sql = @"select UserID,UserCompellation from admins 
where UserName=@UserName and UserPWD=@UserPWD ";
            List<SqlParameter> list = new List<SqlParameter>{
                new SqlParameter("@UserName",Model.ModelAdmins.UserName),
                 new SqlParameter("@UserPWD",Model.ModelAdmins.UserPWD)
            };

            return DBHelper.Zhilianshi(sql,list.ToArray());
        }

        public static int XGMiMa() {

            string sql = @"update admins set UserPWD=@UserPWD";
            List<SqlParameter> list = new List<SqlParameter>{
                  new SqlParameter("@UserPWD",Model.ModelAdmins.UserPWD)
            };

            return DBHelper.Update(sql,list.ToArray());

        }

    }
}
